﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace MassMailing.WPF.Commands
{
    /// <summary>
    /// The interface for any class that used the command 
    /// design pattern.
    /// </summary>
    public interface ICommand
    {
        /// <summary>
        /// Executes the command for the specified class.
        /// </summary>
        /// <param name="asynchronous">
        /// Whether to perform the operation synchronously or asynchronously.
        /// </param>
        /// <returns>
        /// A task that has been executed that can optionaly be used to wait
        /// on completion of execution.
        /// </returns>
        Task Execute(bool asynchronous);

        /// <summary>
        /// The list of exceptions that have occurred when executing the command.
        /// </summary>
        List<Exception> UnhandledExceptions { get; }
    }
}
